<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The SimpleXMLIterator class</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="simplexmlelement.xpath.html">SimpleXMLElement::xpath</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="simplexmliterator.current.html">SimpleXMLIterator::current</a></div>
 <div class="up"><a href="book.simplexml.html">SimpleXML</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="class.simplexmliterator" class="reference">
 <h1 class="title">The SimpleXMLIterator class</h1>
 

 <div class="partintro"><p class="verinfo">(PHP 5 &gt;= 5.1.0)</p>


  <div class="section" id="simplexmliterator.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    The SimpleXMLIterator provides recursive iteration over all nodes of a <a href="class.simplexmlelement.html" class="classname">SimpleXMLElement</a> object.
   </p>
  </div>


  <div class="section" id="simplexmliterator.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass"></div>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <strong class="classname">SimpleXMLIterator</strong>
     </span>

     <span class="ooclass">
      <span class="modifier">extends</span>
      <a href="class.simplexmlelement.html" class="classname">SimpleXMLElement</a>
     </span>

     <span class="oointerface">implements 
      <span class="interfacename"><a href="class.recursiveiterator.html" class="interfacename">RecursiveIterator</a></span>
     </span>

     <span class="oointerface">, 
      <span class="interfacename"><a href="class.countable.html" class="interfacename">Countable</a></span>
     </span>

     {</div>


    

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">mixed</span><span class="methodname"><a href="simplexmliterator.current.html" class="methodname">current</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">SimpleXMLIterator</span><span class="methodname"><a href="simplexmliterator.getchildren.html" class="methodname">getChildren</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="simplexmliterator.haschildren.html" class="methodname">hasChildren</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">mixed</span><span class="methodname"><a href="simplexmliterator.key.html" class="methodname">key</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="simplexmliterator.next.html" class="methodname">next</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="simplexmliterator.rewind.html" class="methodname">rewind</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="simplexmliterator.valid.html" class="methodname">valid</a></span>
    ( <span class="methodparam">void</span>
   )</div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 继承的方法 */</div>
    <div class="constructorsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="methodname"><a href="simplexmlelement.construct.html" class="methodname">SimpleXMLElement::__construct</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$data</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$options</code><span class="initializer"> = 0</span></span>
   [, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$data_is_url</code><span class="initializer"> = false</span></span>
   [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$ns</code><span class="initializer"> = &quot;&quot;</span></span>
   [, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$is_prefix</code><span class="initializer"> = false</span></span>
  ]]]] )</div>

    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="simplexmlelement.addattribute.html" class="methodname">SimpleXMLElement::addAttribute</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>
   [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$value</code></span>
   [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$namespace</code></span>
  ]] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">SimpleXMLElement</span><span class="methodname"><a href="simplexmlelement.addchild.html" class="methodname">SimpleXMLElement::addChild</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>
   [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$value</code></span>
   [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$namespace</code></span>
  ]] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">mixed</span><span class="methodname"><a href="simplexmlelement.asxml.html" class="methodname">SimpleXMLElement::asXML</a></span>
    ([ <span class="methodparam"><span class="type">string</span> <code class="parameter">$filename</code></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">SimpleXMLElement</span><span class="methodname"><a href="simplexmlelement.attributes.html" class="methodname">SimpleXMLElement::attributes</a></span>
    ([ <span class="methodparam"><span class="type">string</span> <code class="parameter">$ns</code><span class="initializer"> = <strong><code>NULL</code></strong></span></span>
   [, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$is_prefix</code><span class="initializer"> = false</span></span>
  ]] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">SimpleXMLElement</span><span class="methodname"><a href="simplexmlelement.children.html" class="methodname">SimpleXMLElement::children</a></span>
    ([ <span class="methodparam"><span class="type">string</span> <code class="parameter">$ns</code></span>
   [, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$is_prefix</code><span class="initializer"> = false</span></span>
  ]] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">int</span><span class="methodname"><a href="simplexmlelement.count.html" class="methodname">SimpleXMLElement::count</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span><span class="methodname"><a href="simplexmlelement.getdocnamespaces.html" class="methodname">SimpleXMLElement::getDocNamespaces</a></span>
    ([ <span class="methodparam"><span class="type">bool</span> <code class="parameter">$recursive</code><span class="initializer"> = false</span></span>
   [, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$from_root</code><span class="initializer"> = true</span></span>
  ]] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="simplexmlelement.getname.html" class="methodname">SimpleXMLElement::getName</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span><span class="methodname"><a href="simplexmlelement.getnamespaces.html" class="methodname">SimpleXMLElement::getNamespaces</a></span>
    ([ <span class="methodparam"><span class="type">bool</span> <code class="parameter">$recursive</code><span class="initializer"> = false</span></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="simplexmlelement.registerxpathnamespace.html" class="methodname">SimpleXMLElement::registerXPathNamespace</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$prefix</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$ns</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="simplexmlelement.tostring.html" class="methodname">SimpleXMLElement::__toString</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span><span class="methodname"><a href="simplexmlelement.xpath.html" class="methodname">SimpleXMLElement::xpath</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$path</code></span>
   )</div>

   }</div>

  </div>



 </div>

 











































<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="simplexmliterator.current.html">SimpleXMLIterator::current</a> — Returns the current element</li><li><a href="simplexmliterator.getchildren.html">SimpleXMLIterator::getChildren</a> — Returns the sub-elements of the current element</li><li><a href="simplexmliterator.haschildren.html">SimpleXMLIterator::hasChildren</a> — Checks whether the current element has sub elements.</li><li><a href="simplexmliterator.key.html">SimpleXMLIterator::key</a> — Return current key</li><li><a href="simplexmliterator.next.html">SimpleXMLIterator::next</a> — Move to next element</li><li><a href="simplexmliterator.rewind.html">SimpleXMLIterator::rewind</a> — Rewind to the first element</li><li><a href="simplexmliterator.valid.html">SimpleXMLIterator::valid</a> — Check whether the current element is valid</li></ul>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="simplexmlelement.xpath.html">SimpleXMLElement::xpath</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="simplexmliterator.current.html">SimpleXMLIterator::current</a></div>
 <div class="up"><a href="book.simplexml.html">SimpleXML</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
